package easy;

public class Solution_1266 {

    public int minTimeToVisitAllPoints(int[][] points) {
        int count = 0;
        for (int i = 1; i < points.length; i++) {
            int x = points[i][0] - points[i - 1][0];
            int y = points[i][1] - points[i - 1][1];
            count += Math.max(Math.abs(x), Math.abs(y));
        }
        return count;
    }

    public static void main(String[] args) {
        Solution_1266 model = new Solution_1266();
        System.out.println(model.minTimeToVisitAllPoints(new int[][]{{1, 1}, {3, 4}, {-1, 0}}));
        System.out.println(model.minTimeToVisitAllPoints(new int[][]{{3, 2}, {-2, 2}}));
    }
}
